<template>
    <div>
        <table class="table table-bordered">
            <tr>
                <td>用户名</td>
                <td>
                    <input type="text" v-model="quer.name">
                </td>
            </tr>
            <tr>
                <td>密码</td>
                <td>
                    <input type="password" v-model="quer.pwd">
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="button" value="登录" @click="login" >
                </td>
            </tr>
        </table>


    </div>
</template>



<script setup lang="ts">

import axios from 'axios';
import { ref,reactive } from 'vue';

import { useRouter } from 'vue-router';
const router=useRouter();

let quer=reactive({
    name:"",
    pwd:"",
})

const login=()=>{
    axios({
        method:"get",
        url:"https://localhost:7155/api/Member/Login",
        params:quer,
    })
    .then(res=>{
        console.log(res);
        if(res.data>0){
            alert('登录成功');
            router.push("/showmember")
        }
        else{
            alert('登录失败');
        }
    })
}




</script>












<style scoped>

</style>